/*
 *  realBall.h
 *  opencvExample
 *
 *  Created by 真鍋 大度 on 11/03/02.
 *  Copyright 2011 Rhizomatiks. All rights reserved.
 *
 */
#pragma once
#include "ofMain.h"
//#include "ofxThread.h"
#include "ball.h"
#include "ofxDaito.h"

//class realBall : public ofThread, public ball{
class realBall : public ofThread{	
public:
	realBall(int _myID){
		myID = _myID;
		bActive = false;
		countThread = 0;
		speed = 33;
		int checkPointID;
		pos.set(0, 0);
	}
	
	
	void setSpeed(float _speed);
	void passingCheckPoint(int _checkID, float _speed);
	void passInColorPixels(unsigned char * _colorpixels){
		currentColorPixels = _colorpixels;
	}

	ofColor & getColor()
	{
		return col;
	}
	
	void update(unsigned char * _colorpixels);
	void start();
	void stop();
	void threadedFunction();
	void draw();
	ofVec2f & getPos();
	bool amIActive();
	bool bActiveAnalysedByCheckPoint;
	bool amIActiveAnalysedByCheckPoint();
	int countThread;		
	int speed;
	int checkPointID;
	int x,y;
	ofVec2f pos;
	unsigned char * currentColorPixels;
	bool bActive;
	ofColor col;
	int myID;
		
	static const int w = 200;
	static const int h = 16;	
	
};